<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Elisa3: usart.c File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Elisa3
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('usart_8c.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">usart.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;avr/eeprom.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="usart_8h_source.html">usart.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="leds_8h_source.html">leds.h</a>&quot;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="usart_8c.html#a17d7ccaac0225381a73c6b6056273ee7">initUsart0</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure the usart0 registers to work at 57600 baud (8-bit data, no parity, 1 stop bit). Moreover the interrupt for reception is enabled.  <a href="#a17d7ccaac0225381a73c6b6056273ee7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="usart_8c.html#a734dfb76bf7dd65fc249ddc7aab7e6f9">initUsart1</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure the usart1 registers to work at 57600 baud (8-bit data, no parity, 1 stop bit). Moreover the interrupt for reception is enabled.  <a href="#a734dfb76bf7dd65fc249ddc7aab7e6f9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="usart_8c.html#a8a5f07a72467236ce8d7aeeedbf0657d">closeUsart</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Close the usart peripheral and disable all interrupts.  <a href="#a8a5f07a72467236ce8d7aeeedbf0657d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="usart_8c.html#a332793b2239f4124b2f95f3107bcbcef">usart0Transmit</a> (unsigned char data, unsigned char isBlocking)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Transfer one byte of data; it's blocking (wait until the buffer is empty).  <a href="#a332793b2239f4124b2f95f3107bcbcef"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="usart_8c.html#aa8fd2faa9959089598765d2a574bcede">usart1Transmit</a> (unsigned char data, unsigned char isBlocking)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Transfer one byte of data; it's blocking (wait until the buffer is empty).  <a href="#aa8fd2faa9959089598765d2a574bcede"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="usart_8c.html#aa3ab08a0a9c26cf866ac19225033c3d5">usart0InputBufferEmpty</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether there is something to read from usart0.  <a href="#aa3ab08a0a9c26cf866ac19225033c3d5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="usart_8c.html#a0d3c76e7c346f2905246c9091d676679">usart0Receive</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait until a byte has been received or the timeout is expired.  <a href="#a0d3c76e7c346f2905246c9091d676679"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="usart_8c.html#a084f0a9cf05b1877bd8a71a90dae7ff8">ISR</a> (USART0_RX_vect)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a8a5f07a72467236ce8d7aeeedbf0657d"></a><!-- doxytag: member="usart.c::closeUsart" ref="a8a5f07a72467236ce8d7aeeedbf0657d" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="usart_8h.html#a8a5f07a72467236ce8d7aeeedbf0657d">closeUsart</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Close the usart peripheral and disable all interrupts. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a17d7ccaac0225381a73c6b6056273ee7"></a><!-- doxytag: member="usart.c::initUsart0" ref="a17d7ccaac0225381a73c6b6056273ee7" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="usart_8h.html#a17d7ccaac0225381a73c6b6056273ee7">initUsart0</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Configure the usart0 registers to work at 57600 baud (8-bit data, no parity, 1 stop bit). Moreover the interrupt for reception is enabled. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a734dfb76bf7dd65fc249ddc7aab7e6f9"></a><!-- doxytag: member="usart.c::initUsart1" ref="a734dfb76bf7dd65fc249ddc7aab7e6f9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="usart_8h.html#a734dfb76bf7dd65fc249ddc7aab7e6f9">initUsart1</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Configure the usart1 registers to work at 57600 baud (8-bit data, no parity, 1 stop bit). Moreover the interrupt for reception is enabled. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a084f0a9cf05b1877bd8a71a90dae7ff8"></a><!-- doxytag: member="usart.c::ISR" ref="a084f0a9cf05b1877bd8a71a90dae7ff8" args="(USART0_RX_vect)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="utility_8c.html#a7cfcbe42bd266750aeb6e5d71e5ea479">ISR</a> </td>
          <td>(</td>
          <td class="paramtype">USART0_RX_vect&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="aa3ab08a0a9c26cf866ac19225033c3d5"></a><!-- doxytag: member="usart.c::usart0InputBufferEmpty" ref="aa3ab08a0a9c26cf866ac19225033c3d5" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char <a class="el" href="usart_8h.html#aa3ab08a0a9c26cf866ac19225033c3d5">usart0InputBufferEmpty</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check whether there is something to read from usart0. </p>
<dl class="retval"><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>input buffer not empty </td></tr>
    <tr><td class="paramname">1</td><td>input buffer empty </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a0d3c76e7c346f2905246c9091d676679"></a><!-- doxytag: member="usart.c::usart0Receive" ref="a0d3c76e7c346f2905246c9091d676679" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char <a class="el" href="usart_8h.html#a0d3c76e7c346f2905246c9091d676679">usart0Receive</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Wait until a byte has been received or the timeout is expired. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>byte received </dd></dl>

</div>
</div>
<a class="anchor" id="a332793b2239f4124b2f95f3107bcbcef"></a><!-- doxytag: member="usart.c::usart0Transmit" ref="a332793b2239f4124b2f95f3107bcbcef" args="(unsigned char data, unsigned char isBlocking)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="usart_8h.html#a332793b2239f4124b2f95f3107bcbcef">usart0Transmit</a> </td>
          <td>(</td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>isBlocking</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Transfer one byte of data; it's blocking (wait until the buffer is empty). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>data to be sent through usart0 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="aa8fd2faa9959089598765d2a574bcede"></a><!-- doxytag: member="usart.c::usart1Transmit" ref="aa8fd2faa9959089598765d2a574bcede" args="(unsigned char data, unsigned char isBlocking)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="usart_8h.html#aa8fd2faa9959089598765d2a574bcede">usart1Transmit</a> </td>
          <td>(</td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>isBlocking</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Transfer one byte of data; it's blocking (wait until the buffer is empty). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>data to be sent through usart1 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>none </dd></dl>

</div>
</div>
</div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="usart_8c.html">usart.c</a>      </li>

    <li class="footer">Generated on Thu Dec 4 2014 08:30:53 for Elisa3 by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
